package cn.libinal.scloud.base.entity;

import cn.libinal.scloud.base.common.entity.JpaBaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 * @author libin
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "oauth_client_details")
public class Client extends JpaBaseEntity {

    @Column(name = "client_id")
    @NotNull
    private String clientId;

    @Column(name = "resource_ids")
    private String resourceIds;

    @Column(name = "client_secret")
    @NotNull
    private String clientSecret;

    @Column(name = "is_secret_required")
    private Boolean isSecretRequired;

    @Column(name = "is_scope")
    private Boolean isScoped;

    @Column(name = "scope")
    private String scope;

    @Column(name = "authorized_grant_types")
    @NotNull
    private String authorizedGrantTypes;

    @Column(name = "web_server_redirect_uri")
    @NotNull
    private String registeredRedirectUri;

    @Column(name = "authorities")
    private String authorities;

    @Column(name = "access_token_validity")
    @NotNull
    private Integer accessTokenValidity;

    @Column(name = "refresh_token_validity")
    @NotNull
    private Integer refreshTokenValidity;

    @Column(name = "additional_information")
    private String additionalInformation;

    @Column(name = "is_auto_approve")
    private Boolean isAutoApprove;
}
